// import Vue from 'vue'

// Vue.use(VueRouter)

// const routes = [

// ]

// const router = new VueRouter({
//   mode: 'history',
//   base: process.env.BASE_URL,
//   routes
// })

// export default router

import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'Index',
    meta: {
      scrollToTop: true
    },
    component: () => import('../views/Index.vue')
  },
  {
    path: '/abt',
    name: 'AboutIndex',
    component: () => import('../views/AboutUs/AboutContent/Index.vue')
  }
];

//路由导航冗余报错（路由重复）
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
});

export default router;
